import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

const store = new Vuex.Store({
  state:{
    formType: {},
    tabinfo:{}
  },
  getters:{
    getType:function (state) {
      if(!state.formType){
        state.formType = localStorage.getItem('formType')
      }
      return state.formType;
    }
  },
  mutations:{
    //格式：类型(名字)+处理函数
    //加1
    changetype(state,type) {
      console.log(state)//state对象
      state.formType = type;
    },
    changetab(state,type) {
      console.log(state)//state对象
      state.tabinfo = type;
    }
  },
  actions:{
    
  }
})

export default store